package club.justwill.single.model;

/**
 * Created by luoyu on 1/4/16.
 */
public class OrderStatus {
    public static int ORDER_PAID = 10;//已支付未收货
    public static int ORDER_NOT_PAID = 20;//未支付
    public static final int ORDER_REVOKE = 30;//订单异常
    public static final int ORDER_RECEIVED = 40; //已收货
    public static final int ORDER_INVALID = 50; //订单无效

    public static String getOrderStatus(int type) {
        switch (type) {
            case 10 : return "ORDER_PAID";
            case 20 : return "ORDER_NOT_PAID";
            case 30 : return "ORDER_REVOKE";
            case 40 : return "ORDER_RECEIVED";
            case 50 : return "ORDER_INVALID";
            default : return null;
        }
    }

    public static int getOrderStatusCode(String type) {
        if(type.equals("ORDER_PAID")) return 10;
        if(type.equals("ORDER_NOT_PAID")) return 20;
        if(type.equals("ORDER_REVOKE")) return 30;
        if(type.equals("ORDER_RECEIVED")) return 40;
        if(type.equals("ORDER_INVALID")) return 50;
        return 0;
    }
}
